home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 May: Tool Chest / Developer CD Series May 1996 (Tool Chest) (Apple Computer) (1996).iso / Tool Chest / Development Tools & Languages / Macintosh Common Lisp Related / Drag and Drop / about Drag and Drop next >
Encoding:
Internet Message Format  |  1994-09-12  |  2.1 KB  |  [TEXT/ttxt]

  1. Date: 24 Aug 94 12:51 GMT
  2. From: CAMPER@AppleLink.Apple.COM (Camper, Dan)
  3. Subject: Mac Drag and Drop
  4. To: INFO-MCL@CAMBRIDGE.APPLE.COM
  5.  
  6. I've posted an MCL module for using the Macintosh Drag and Drop Manager onto
  7. the Cambridge ftp site as well as the necessary interface file.  The paths are:
  8.  
  9.      /pub/mcl/contrib/drag-and-drop.lisp
  10.  
  11.      /pub/mcl/interfaces/Drag.lisp
  12.  
  13. Here is the header from module:
  14.  
  15. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  16. ;;;;
  17. ;;;; Macintosh Drag and Drop for MCL
  18. ;;;;
  19. ;;;; Almost, but quite all of the Macintosh Drag Manager is implemented here.
  20. ;;;; There are a couple of bonuses, though, the biggest being that the
  21. ;;;; implementation easily supports drag and drop behavior among views in a
  22. ;;;; window.
  23. ;;;;
  24. ;;;; General usage notes:
  25. ;;;;
  26. ;;;; o In order to drag items from a view or receive drops the view's window
  27. ;;;;   must include 'drag-&-drop-window-mixin class its definition.
  28. ;;;; o If you want a particular view to be able to receive a drop, make sure
  29. ;;;;   you've specialized the 'drag-receive-drag method.
  30. ;;;; o If you want be able to drag items out of a particular view, specialize
  31. ;;;;   the 'drag-selection-p method.
  32. ;;;; o Events from the Drag Manager are piped through a dispatching function
  33. ;;;;   and sent to MCL methods, which you should specialize.  The methods
  34. ;;;;   are all named 'drag-tracking-xxxx.
  35. ;;;;
  36. ;;;; Following the Real Code are a couple of examples.  The first is a subclass
  37. ;;;; of fred, allowing you to drag selections out as either text data (to other
  38. ;;;; text-oriented applications), text clipping files in the Finder or as MCL
  39. ;;;; files in the Finder.  The second example is a simple view with two text
  40. ;;;; fields that allow dragging and dropping between them.  Both examples allow
  41. ;;;; you to drop text data, text clipping files and text documents into their
  42. ;;;; respective drop locations.  After evaluating the commented code you can
  43. ;;;; bring up the examples via (fred-example) and (text-item-example) in the
  44. ;;;; Listener.
  45.  
  46.  
  47. Please let me know if you have any comments or problems with the code.
  48.  
  49. Dan
  50.  
  51.  
  52.  
  53.